/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFrame_GuiMail.java
 *
 * Created on May 28, 2009, 1:34:23 AM
 */

package doanlythuyet_javaoutlook.MyUserControl;

import BUS.MyAttachBUS;
import BUS.MyMailBUS;
import DTO.MyAttachDTO;
import DTO.MyMailDTO;
import doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp;
import doanlythuyet_javaoutlook.MyEmum.JEnum_TinhTrang;
import doanlythuyet_javaoutlook.MyMail;
import java.awt.Dialog;
import java.awt.event.WindowEvent;
import java.awt.event.WindowStateListener;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.swing.DefaultListModel;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.ListModel;

/**
 *
 * @author Dang Thi Phuong Thao
 */
public class JFrame_GuiMail extends javax.swing.JFrame {

    /** Creates new form JFrame_GuiMail */
    public JFrame_GuiMail() {
        initComponents();
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        //this.setc
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jButton_send2 = new javax.swing.JButton();
        jButton_addressbook = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jTextField_to = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jTextField_cc = new javax.swing.JTextField();
        jButton4 = new javax.swing.JButton();
        jTextField_bcc = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jTextField_subject = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea_noidung = new javax.swing.JTextArea();
        jToolBar2 = new javax.swing.JToolBar();
        jCheckBox_SendHTML = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane_ListAttach = new javax.swing.JScrollPane();
        jList_CacAttach = new javax.swing.JList();
        jButton_ThemAttach = new javax.swing.JButton();
        jButton_XoaAttach = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jButton_Send = new javax.swing.JButton();
        jButton_Send1 = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        jMenu_New = new javax.swing.JMenu();
        jMenuItem_Mail = new javax.swing.JMenuItem();
        jMenuItem_Contact = new javax.swing.JMenuItem();
        jMenuItem_Task = new javax.swing.JMenuItem();
        jMenuItem_Folder = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuItem_Save = new javax.swing.JMenuItem();
        jMenuItem_SaveAs = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator5 = new javax.swing.JSeparator();
        jMenuItem_delete = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        javax.swing.JMenuItem jMenuItem_Close = new javax.swing.JMenuItem();
        jMenu_Edit = new javax.swing.JMenu();
        jMenuItem_Cut = new javax.swing.JMenuItem();
        jMenuItem_Copy = new javax.swing.JMenuItem();
        jMenuItem_Paste = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JSeparator();
        jMenuItem_SelectAll = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JSeparator();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu_Tools = new javax.swing.JMenu();
        jMenuItem_Find = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setName("Form"); // NOI18N

        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp.class).getContext().getResourceMap(JFrame_GuiMail.class);
        jButton_send2.setText(resourceMap.getString("jButton_send2.text")); // NOI18N
        jButton_send2.setFocusable(false);
        jButton_send2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton_send2.setName("jButton_send2"); // NOI18N
        jButton_send2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton_send2);

        jButton_addressbook.setText(resourceMap.getString("jButton_addressbook.text")); // NOI18N
        jButton_addressbook.setFocusable(false);
        jButton_addressbook.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton_addressbook.setName("jButton_addressbook"); // NOI18N
        jButton_addressbook.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton_addressbook);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jTextField_to.setText(resourceMap.getString("jTextField_to.text")); // NOI18N
        jTextField_to.setName("jTextField_to"); // NOI18N

        jButton1.setText(resourceMap.getString("jButton_To.text")); // NOI18N
        jButton1.setName("jButton_To"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText(resourceMap.getString("jButton_cc.text")); // NOI18N
        jButton2.setName("jButton_cc"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jTextField_cc.setText(resourceMap.getString("jTextField_cc.text")); // NOI18N
        jTextField_cc.setName("jTextField_cc"); // NOI18N

        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jTextField_bcc.setName("jTextField_bcc"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jTextField_subject.setText(resourceMap.getString("jTextField_subject.text")); // NOI18N
        jTextField_subject.setName("jTextField_subject"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField_subject, javax.swing.GroupLayout.DEFAULT_SIZE, 607, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField_cc, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField_bcc, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE))
                    .addComponent(jTextField_to, javax.swing.GroupLayout.DEFAULT_SIZE, 607, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jTextField_to, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_cc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4)
                    .addComponent(jTextField_bcc, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_subject, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTextArea_noidung.setColumns(20);
        jTextArea_noidung.setRows(5);
        jTextArea_noidung.setText(resourceMap.getString("jTextArea_noidungmail.text")); // NOI18N
        jTextArea_noidung.setName("jTextArea_noidungmail"); // NOI18N
        jTextArea_noidung.setNextFocusableComponent(jButton_Send);
        jScrollPane1.setViewportView(jTextArea_noidung);

        jToolBar2.setRollover(true);
        jToolBar2.setName("jToolBar2"); // NOI18N

        jCheckBox_SendHTML.setText(resourceMap.getString("jCheckBox_SendHTML.text")); // NOI18N
        jCheckBox_SendHTML.setFocusable(false);
        jCheckBox_SendHTML.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jCheckBox_SendHTML.setName("jCheckBox_SendHTML"); // NOI18N
        jCheckBox_SendHTML.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jCheckBox_SendHTML.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_SendHTMLActionPerformed(evt);
            }
        });
        jToolBar2.add(jCheckBox_SendHTML);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE)
                    .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane_ListAttach.setName("jScrollPane_ListAttach"); // NOI18N

        jList_CacAttach.setModel(new DefaultListModel());
        jList_CacAttach.setName("jList_CacAttach"); // NOI18N
        jScrollPane_ListAttach.setViewportView(jList_CacAttach);

        jButton_ThemAttach.setText(resourceMap.getString("jButton_ThemAttach.text")); // NOI18N
        jButton_ThemAttach.setName("jButton_ThemAttach"); // NOI18N
        jButton_ThemAttach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ThemAttachActionPerformed(evt);
            }
        });

        jButton_XoaAttach.setText(resourceMap.getString("jButton_XoaAttach.text")); // NOI18N
        jButton_XoaAttach.setName("jButton_XoaAttach"); // NOI18N
        jButton_XoaAttach.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_XoaAttachActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane_ListAttach, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton_ThemAttach)
                    .addComponent(jButton_XoaAttach))
                .addContainerGap(36, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane_ListAttach, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jButton_ThemAttach)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton_XoaAttach)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jButton_Send.setText(resourceMap.getString("jButton_send.text")); // NOI18N
        jButton_Send.setName("jButton_send"); // NOI18N
        jButton_Send.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SendActionPerformed(evt);
            }
        });

        jButton_Send1.setText(resourceMap.getString("jButton_Send1.text")); // NOI18N
        jButton_Send1.setName("jButton_Send1"); // NOI18N
        jButton_Send1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_Send1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton_Send, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                .addComponent(jButton_Send1)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton_Send1)
                    .addComponent(jButton_Send, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))
                .addContainerGap())
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        jMenu_New.setText(resourceMap.getString("jMenu_New.text")); // NOI18N
        jMenu_New.setName("jMenu_New"); // NOI18N

        jMenuItem_Mail.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Mail.setText(resourceMap.getString("jMenuItem_Mail.text")); // NOI18N
        jMenuItem_Mail.setName("jMenuItem_Mail"); // NOI18N
        jMenu_New.add(jMenuItem_Mail);

        jMenuItem_Contact.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Contact.setText(resourceMap.getString("jMenuItem_Contact.text")); // NOI18N
        jMenuItem_Contact.setName("jMenuItem_Contact"); // NOI18N
        jMenu_New.add(jMenuItem_Contact);

        jMenuItem_Task.setText(resourceMap.getString("jMenuItem_Task.text")); // NOI18N
        jMenuItem_Task.setName("jMenuItem_Task"); // NOI18N
        jMenu_New.add(jMenuItem_Task);

        jMenuItem_Folder.setText(resourceMap.getString("jMenuItem_Folder.text")); // NOI18N
        jMenuItem_Folder.setName("jMenuItem_Folder"); // NOI18N
        jMenu_New.add(jMenuItem_Folder);

        fileMenu.add(jMenu_New);

        jSeparator1.setName("jSeparator1"); // NOI18N
        fileMenu.add(jSeparator1);

        jMenuItem_Save.setText(resourceMap.getString("jMenuItem_Save.text")); // NOI18N
        jMenuItem_Save.setName("jMenuItem_Save"); // NOI18N
        fileMenu.add(jMenuItem_Save);

        jMenuItem_SaveAs.setText(resourceMap.getString("jMenuItem_SaveAs.text")); // NOI18N
        jMenuItem_SaveAs.setName("jMenuItem_SaveAs"); // NOI18N
        fileMenu.add(jMenuItem_SaveAs);

        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        fileMenu.add(jMenuItem2);

        jSeparator5.setName("jSeparator5"); // NOI18N
        fileMenu.add(jSeparator5);

        jMenuItem_delete.setText(resourceMap.getString("jMenuItem_delete.text")); // NOI18N
        jMenuItem_delete.setName("jMenuItem_delete"); // NOI18N
        fileMenu.add(jMenuItem_delete);

        jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        fileMenu.add(jMenuItem3);

        jSeparator2.setName("jSeparator2"); // NOI18N
        fileMenu.add(jSeparator2);

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp.class).getContext().getActionMap(JFrame_GuiMail.class, this);
        jMenuItem_Close.setAction(actionMap.get("quit")); // NOI18N
        jMenuItem_Close.setText(resourceMap.getString("jMenuItem_Close.text")); // NOI18N
        jMenuItem_Close.setName("jMenuItem_Close"); // NOI18N
        fileMenu.add(jMenuItem_Close);

        menuBar.add(fileMenu);

        jMenu_Edit.setText(resourceMap.getString("jMenu_Edit.text")); // NOI18N
        jMenu_Edit.setName("jMenu_Edit"); // NOI18N

        jMenuItem_Cut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Cut.setText(resourceMap.getString("jMenuItem_Cut.text")); // NOI18N
        jMenuItem_Cut.setName("jMenuItem_Cut"); // NOI18N
        jMenu_Edit.add(jMenuItem_Cut);

        jMenuItem_Copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Copy.setText(resourceMap.getString("jMenuItem_Copy.text")); // NOI18N
        jMenuItem_Copy.setName("jMenuItem_Copy"); // NOI18N
        jMenu_Edit.add(jMenuItem_Copy);

        jMenuItem_Paste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Paste.setText(resourceMap.getString("jMenuItem_Paste.text")); // NOI18N
        jMenuItem_Paste.setName("jMenuItem_Paste"); // NOI18N
        jMenu_Edit.add(jMenuItem_Paste);

        jSeparator3.setName("jSeparator3"); // NOI18N
        jMenu_Edit.add(jSeparator3);

        jMenuItem_SelectAll.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_SelectAll.setText(resourceMap.getString("jMenuItem_SelectAll.text")); // NOI18N
        jMenuItem_SelectAll.setName("jMenuItem_SelectAll"); // NOI18N
        jMenu_Edit.add(jMenuItem_SelectAll);

        jSeparator4.setName("jSeparator4"); // NOI18N
        jMenu_Edit.add(jSeparator4);

        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenu_Edit.add(jMenuItem1);

        menuBar.add(jMenu_Edit);

        jMenu_Tools.setText(resourceMap.getString("jMenu_Tools.text")); // NOI18N
        jMenu_Tools.setName("jMenu_Tools"); // NOI18N

        jMenuItem_Find.setText(resourceMap.getString("jMenuItem_Find.text")); // NOI18N
        jMenuItem_Find.setName("jMenuItem_Find"); // NOI18N
        jMenu_Tools.add(jMenuItem_Find);

        menuBar.add(jMenu_Tools);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 663, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    public void ThucHienCacBuocGoiMailTuGiaoDienNguoiDung () throws Exception{
        MimeMessage mess = GoiMailTuGiaoDienNguoiDung();
        int idMail = luuMailVaoCSDL(mess,"Mails\\Sent\\");
        luuAttachVaoCSDL(mess, idMail);
        JOptionPane.showMessageDialog(null, "Qua trinh ket thuc");
    }
    /**
     * luu cac part vao HDD
     * @param cacPart
     * @param idmal     id dung de tao attachdto cung dung de tao thu muc luu tru cho cac attach
     * @return          cac AttachDTO cua file duoc luu
     * @throws java.io.IOException
     * @throws javax.mail.MessagingException
     * da hoan thanh
     */
    public static ArrayList<MyAttachDTO> luuTruCacPartVaoHDD (ArrayList <Part> cacPart, int idMail) throws IOException, MessagingException{
        int i = 0;
        String reDir = "\\MailAttachs\\";

        ArrayList<MyAttachDTO> Kq = new ArrayList<MyAttachDTO>();
        //<Kiem tra xem thu muc chua da co chua neu chua thi tao>
        String dir = new File(".").getAbsolutePath();;//DoAnLyThuyet_JavaOutLookApp.getCurdir();
        dir += "\\MailAttachs\\" + idMail + "\\";
        reDir += idMail + "\\";
        File file = new File(dir);
        if (!file.exists()) {
            file.mkdirs();
        }
        //</Kiem tra xem thu muc chua da co chua neu chua thi tao>
        for (Part part : cacPart){
            //tao file moi
            dir += i++ + part.getFileName();
            reDir += i + part.getFileName();
            file = new File(dir);
            file.createNewFile();
            //FileOutputStream outStream = new FileOutputStream(file);
            //part.writeTo(outStream);

            //ghi file
            InputStream input = part.getInputStream();
            FileOutputStream fos = new FileOutputStream(file);
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            BufferedInputStream bis = new BufferedInputStream(input);
            int aByte;
            while ((aByte = bis.read()) != -1) {
                bos.write(aByte);
            }
            bis.close();
            bos.close();

            //them duong dan vao Kq
            Kq.add(new MyAttachDTO(0, idMail, reDir, part.getFileName()));
        }
        return Kq;
    }

    /**
     * Luu tru message vao HDD
     * @param mess
     * @throws java.io.IOException
     * @throws javax.mail.MessagingException
     * @throws java.io.FileNotFoundException
     * @return file path cua file chua mess
     */
    public static String luuTruMineMessageVaoHDD(MimeMessage mess) throws IOException, MessagingException, FileNotFoundException {
        //dataPath =
        String reDir = "\\MailItems\\";
        String dir = new File(".").getAbsolutePath();;//DoAnLyThuyet_JavaOutLookApp.getCurdir();
        
    //    JOptionPane.showMessageDialog(null, new File(dir).getCanonicalPath());
        File file = new File(dir + "\\MailItems\\");
        if (!file.exists()) {
            file.mkdirs();
        }
        reDir += String.valueOf(mess.getSentDate().getTime()) + ".mjm";
        dir += reDir;
        file = new File(dir);
        file.createNewFile();
        FileOutputStream outStream = new FileOutputStream(file);
        mess.writeTo(outStream);
        return reDir;
        //mess = new MimeMessage(mess.gets, is)
    }
    private MimeMessage taoMineMessageInputNguoiDung (boolean isToSend) throws Exception{
        MyMail myMail = new MyMail(DoAnLyThuyet_JavaOutLookApp.getSmtp_host(), DoAnLyThuyet_JavaOutLookApp.getPop3_host(), DoAnLyThuyet_JavaOutLookApp.getUser()
                , DoAnLyThuyet_JavaOutLookApp.getPass(), DoAnLyThuyet_JavaOutLookApp.getProxy(), DoAnLyThuyet_JavaOutLookApp.getPort());
        Session session = myMail.getMailSession(isToSend);
        //session.
        MimeMessage message = new MimeMessage(session);
        String user = myMail.getUser();
        message.setFrom(new InternetAddress(user));


        //Them danh sach nguoi nhan---------------------------------------------
        String str_ToAdd = getJTextField_to().getText();
        InternetAddress toAddress = new InternetAddress(str_ToAdd);

        message.addRecipient(Message.RecipientType.TO, toAddress);

            //----------------------------CC---------------------
        String sAr_CCAdd[] = getJTextField_cc().getText().split(",");
        //InternetAddress[] CCAddress = new InternetAddress[sAr_CCAdd.length];    // To get the array of addresses
        InternetAddress CCAddress = new InternetAddress();

        for( int i=0; i < sAr_CCAdd.length; i++ ) {
            if (!sAr_CCAdd[i].equals("")){
                CCAddress = new InternetAddress(sAr_CCAdd[i]);
                message.addRecipient(Message.RecipientType.CC, CCAddress);
            }
        }
/*
        for( int i=0; i < CCAddress.length; i++) {
            message.addRecipient(Message.RecipientType.CC, CCAddress[i]);
        }
*/
            //---------------------------BCC---------------------------
        String sAr_BCCAdd[] = jTextField_bcc.getText().split(",");
        //InternetAddress[] BCCAddress = new InternetAddress[sAr_BCCAdd.length];    // To get the array of addresses
        InternetAddress BCCAddress = new InternetAddress();

        //Them danh sach nguoi nhanInternetAddress CCAddress = new InternetAddress();

        for( int i=0; i < sAr_BCCAdd.length; i++ ) {
            if (!sAr_CCAdd[i].equals("")){
                BCCAddress = new InternetAddress(sAr_CCAdd[i]);
                message.addRecipient(Message.RecipientType.CC, BCCAddress);
            }
        }
/*
        for( int i=0; i < BCCAddress.length; i++ ) {
            BCCAddress[i] = new InternetAddress(sAr_BCCAdd[i]);
        }

        for( int i=0; i < BCCAddress.length; i++) {
            message.addRecipient(Message.RecipientType.BCC, BCCAddress[i]);
        }
 */
        //--------------------------------------------------------------------------

        String str_Subject = jTextField_subject.getText();
        message.setSubject(str_Subject);

        String str_ContentType = "text/";
        boolean b_IsSendHTML = jCheckBox_SendHTML.isSelected();
        str_ContentType += b_IsSendHTML ? "html" : "plain";
        String str_Content = jTextArea_noidung.getText();
/*
        message.setContent(str_Content, str_ContentType);
 * */
        
        MimeBodyPart noiDungMail = new MimeBodyPart();
        noiDungMail.setContent(str_Content, str_ContentType);

        ListModel model = jList_CacAttach.getModel();
        MimeBodyPart cacAttach[] = new MimeBodyPart[model.getSize()];
        for (int i = 0; i <model.getSize(); i++){
            File file = new File(model.getElementAt(i).toString());
            DataSource source = new FileDataSource(file);
            cacAttach[i] = new MimeBodyPart();
            cacAttach[i].setDataHandler(new DataHandler(source));
            cacAttach[i].setFileName(file.getName());
        }
        Multipart multiPart = new MimeMultipart();
        multiPart.addBodyPart(noiDungMail);
        for (int i = 0 ; i < cacAttach.length; i++)
            multiPart.addBodyPart(cacAttach[i]);
        message.setContent(multiPart);

        //message.setContent(str_Content, str_ContentType);
         return message;
    }
    /**
     * Goi mail voi cac input cua nguoi dung
     */
    private MimeMessage GoiMailTuGiaoDienNguoiDung() throws Exception
    {
        MimeMessage mess = taoMineMessageInputNguoiDung(true);
        MyMail myMail = new MyMail(DoAnLyThuyet_JavaOutLookApp.getSmtp_host(), DoAnLyThuyet_JavaOutLookApp.getPop3_host(), DoAnLyThuyet_JavaOutLookApp.getUser()
                , DoAnLyThuyet_JavaOutLookApp.getPass(), DoAnLyThuyet_JavaOutLookApp.getProxy(), DoAnLyThuyet_JavaOutLookApp.getPort());
        mess.setSentDate(new Date());
        mess.setContentID(String.valueOf(new Date().getTime()));
        //luuAttachVaoCSDL(mess);
        myMail.sendMail(mess);
        return mess;
    }

    public static int luuMailVaoCSDL(MimeMessage mess, String duongDanThuMuc) throws MessagingException, IOException, IOException{

        Folder folder = mess.getFolder();
        Store store = null;
        if (folder != null){
            store = folder.getStore();
            store.connect();
            folder.open(Folder.READ_ONLY);
        }

        MyMailDTO mailDTO = new MyMailDTO(mess);
        String duongDanFileChuaNoiDung = luuTruMineMessageVaoHDD(mess);
        mailDTO.setM_DuongDanFileChuaNoiDung(duongDanFileChuaNoiDung);
        mailDTO.setM_DuongDanThuMuc(duongDanThuMuc);
        if (duongDanThuMuc.equals("Mails\\Sent\\"))
            mailDTO.setM_TinhTrang(JEnum_TinhTrang.DaXem.value());
        else
            mailDTO.setM_TinhTrang(JEnum_TinhTrang.Moi.value());

        MyMailBUS mailBUS = new MyMailBUS();
        int mailID = mailBUS.themMail(mailDTO);
     //   JOptionPane.showMessageDialog(null, "Luu tru thanh cong mail ID:" + mailID);

        if (folder != null && store != null){
            folder.close(false);
            store.close();
        }
        return mailID;
        //mess = new MimeMessage(mess.gets, is)
    }
    /**
     * Dau tien tao danh sach attach tu mess
     * luu attach vao HDD sau do luu vao csdl
     * @param mess      MimeMessage chua cac attach
     * @param idMail    id cua MyMailDTO (dung de tao dinh danh cho file chua thong tin attach khi luu tren o cung)
     * @return          danh sach cai id cua cac attach moi dc tao ra
     * @throws javax.mail.MessagingException
     * @throws java.io.IOException
     */
    public static ArrayList<Integer> luuAttachVaoCSDL(MimeMessage mess, int idMail) throws MessagingException, IOException{
        ArrayList<Part> cacAttach = MyMail.layCacAttachCuaMail(mess);
        ArrayList<MyAttachDTO> cacAttachDTO = luuTruCacPartVaoHDD(cacAttach, idMail);

        ArrayList<Integer> Kq = new ArrayList<Integer>();
        MyAttachBUS attachBUS = new MyAttachBUS();
        for (MyAttachDTO attachDTO : cacAttachDTO){
            int i = attachBUS.themAttach(attachDTO);
            Kq.add(i);
        }
        return Kq;
    }
    private void jButton_SendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SendActionPerformed
        try {
            ThucHienCacBuocGoiMailTuGiaoDienNguoiDung();
        } catch (Exception ex) {
            Logger.getLogger(JFrame_GuiMail.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
}//GEN-LAST:event_jButton_SendActionPerformed

    private void jButton_ThemAttachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ThemAttachActionPerformed
        // TODO add your handling code here:
        File cacFileDuocChon[] = moDialogChonFile(true);
        DefaultListModel model = (DefaultListModel) jList_CacAttach.getModel();
        for (File file : cacFileDuocChon){
            model.addElement(file.getAbsolutePath());
        }
        jList_CacAttach.setModel(model);
    }//GEN-LAST:event_jButton_ThemAttachActionPerformed

    private void jButton_XoaAttachActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_XoaAttachActionPerformed
        // TODO add your handling code here:
        DefaultListModel model = (DefaultListModel) jList_CacAttach.getModel();
        //model.
        int soLuongAttachDuocXoa = 0;
        int cacAttachDuocChon[] = jList_CacAttach.getSelectedIndices();
        for (int i : cacAttachDuocChon){
            model.remove(i - soLuongAttachDuocXoa++);
        }
        jList_CacAttach.setModel(model);
        jScrollPane_ListAttach.setViewportView(jList_CacAttach);
    }//GEN-LAST:event_jButton_XoaAttachActionPerformed

    private void jButton_Send1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_Send1ActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_jButton_Send1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
            // TODO add your handling code here:
            JDialog_ChonContact chonContact = new JDialog_ChonContact(this, true);
            chonContact.setVisible(true);
            
            //frame_Contact.add
            if (chonContact.getCacEmailDuocChon().length() > 0)
                jTextField_to.setText(chonContact.getCacEmailDuocChon().split(",")[0]);

            chonContact.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        JDialog_ChonContact chonContact = new JDialog_ChonContact(this, true);
        chonContact.setVisible(true);

        //frame_Contact.add
        if (chonContact.getCacEmailDuocChon().length() > 0)
            jTextField_cc.setText(jTextField_cc.getText() + "," + chonContact.getCacEmailDuocChon());

        chonContact.dispose();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        JDialog_ChonContact chonContact = new JDialog_ChonContact(this, true);
        chonContact.setVisible(true);

        //frame_Contact.add
        if (chonContact.getCacEmailDuocChon().length() > 0)
            jTextField_bcc.setText(jTextField_bcc.getText() + "," + chonContact.getCacEmailDuocChon());

        chonContact.dispose();
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jCheckBox_SendHTMLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_SendHTMLActionPerformed
        // TODO add your handling code here:
        String html = "<html>\n\t<head>\n\t</head>\n\t<body>\n\t\t" + jTextArea_noidung.getText() +
                "\n\t</body>\n</html>";
        jTextArea_noidung.setText(html);
    }//GEN-LAST:event_jCheckBox_SendHTMLActionPerformed

    public static File[] moDialogChonFile(Boolean choPhepChonNhieuFile)
    {
        File Kq[] = new File[0];
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setMultiSelectionEnabled(choPhepChonNhieuFile);
        int ketQuaShowOpenDialog = fileChooser.showOpenDialog(null);
        if (ketQuaShowOpenDialog == JFileChooser.APPROVE_OPTION){
            //fileChooser.getf
            Kq = new File[fileChooser.getSelectedFiles().length];
            Kq = fileChooser.getSelectedFiles();
        }
        return Kq;
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrame_GuiMail().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton_Send;
    private javax.swing.JButton jButton_Send1;
    private javax.swing.JButton jButton_ThemAttach;
    private javax.swing.JButton jButton_XoaAttach;
    private javax.swing.JButton jButton_addressbook;
    private javax.swing.JButton jButton_send2;
    private javax.swing.JCheckBox jCheckBox_SendHTML;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JList jList_CacAttach;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem_Contact;
    private javax.swing.JMenuItem jMenuItem_Copy;
    private javax.swing.JMenuItem jMenuItem_Cut;
    private javax.swing.JMenuItem jMenuItem_Find;
    private javax.swing.JMenuItem jMenuItem_Folder;
    private javax.swing.JMenuItem jMenuItem_Mail;
    private javax.swing.JMenuItem jMenuItem_Paste;
    private javax.swing.JMenuItem jMenuItem_Save;
    private javax.swing.JMenuItem jMenuItem_SaveAs;
    private javax.swing.JMenuItem jMenuItem_SelectAll;
    private javax.swing.JMenuItem jMenuItem_Task;
    private javax.swing.JMenuItem jMenuItem_delete;
    private javax.swing.JMenu jMenu_Edit;
    private javax.swing.JMenu jMenu_New;
    private javax.swing.JMenu jMenu_Tools;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane_ListAttach;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JTextArea jTextArea_noidung;
    private javax.swing.JTextField jTextField_bcc;
    private javax.swing.JTextField jTextField_cc;
    private javax.swing.JTextField jTextField_subject;
    private javax.swing.JTextField jTextField_to;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JMenuBar menuBar;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the jTextField_cc
     */
    public javax.swing.JTextField getJTextField_cc() {
        return jTextField_cc;
    }

    /**
     * @param jTextField_cc the jTextField_cc to set
     */
    public void setJTextField_cc(javax.swing.JTextField jTextField_cc) {
        this.jTextField_cc = jTextField_cc;
    }

    /**
     * @return the jTextField_to
     */
    public javax.swing.JTextField getJTextField_to() {
        return jTextField_to;
    }

    /**
     * @param jTextField_to the jTextField_to to set
     */
    public void setJTextField_to(javax.swing.JTextField jTextField_to) {
        this.jTextField_to = jTextField_to;
    }


    //private JList jList_Attach = new JList(new DefaultListModel());
}
